package com.vladimirkolarevic.eventplanner.beans;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

import com.vladimirkolarevic.eventplanner.Comment;
import com.vladimirkolarevic.eventplanner.User;
@Entity
public class CommentBean implements Comment {

	@Id
	@GeneratedValue
	private Long id;
	
	@Basic(optional = false)
	private String comment;
	
	@OneToOne(targetEntity=UserBean.class,cascade=CascadeType.ALL)
	
	private User user;
	
	public CommentBean() {
		// TODO Auto-generated constructor stub
	}
	
	public String getComment() {
		// TODO Auto-generated method stub
		return comment;
	}

	public Long getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public User getUser() {
		// TODO Auto-generated method stub
		return user;
	}

	public void setComment(String comment) {
		this.comment = comment; 

	}

	public void setUser(User user) {
		this.user = user;

	}

}
